#include "common.h"

Common::Common()
{
    //ctor
}

Common::~Common()
{
    //dtor
}

Mat dropImage(Mat image, int x, int y, int width, int height)
{
    Rect rec = Rect(x, y, width, height);
    return image(rec);
}

void printData(Mat image)
{
    for(int k = 0; k < image.channels(); k++)
    {
        cout<< "channel " << k << " :" << endl;
        for (int i = 0; i < image.rows; i++)
        {
            for (int j = 0; j < image.cols; j++)
            {
                Vec3b &intensity = image.at<Vec3b>(i, j);
                cout<< setw(4) << (float) intensity.val[k];
            }
            cout<< endl;
        }
        cout<< endl << endl << endl;
    }
}
